<? 
	$accesslevel=1;
	$title="Change Email";
	require("required/dbconnect.php");
	require("required/share_function.php");
	require("required/header.php"); 
	require("required/chkuser.php");
	$getdata=mysql_query("select * from os_member where id=".$member_id);
	$a=mysql_fetch_array($getdata,MYSQL_ASSOC);
	
?>
<script language="javascript">
	function validatefrm(frm1)
	{
		if(document.frm1.email.value=="")
		{
			alert("Please enter your email!");
			document.frm1.email.focus();
			return false;
		}
		if (document.frm1.email.value!="")
 		{
			var x = document.frm1.email.value;
			var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			if (filter.test(x)==false)
			{ 
				alert('Invalid email');
				document.frm1.email.focus();
				document.frm1.email.select();
				return false;
			}
		
  		}
		return true;
	}
</script>

		
			<table width="100%" cellpadding="6" cellspacing="0">
					<td align="left" class="page_title_bar" width="100%">
					 Change Email
					</td>
				<tr>
					<td align="center" height="400" valign="top">
						<table width="90%" >
							<form method="post" action="os_editemail2.php" name="frm1" onSubmit="return validatefrm(this)">
								<tr valign="middle">
								<td>Email</td><td>:</td><td><input type="text" name="email" maxlength="100" size="30"></td>
								
								</tr>
								<tr>
									<td colspan="3"><font color="#FF0000">Important: You will need to reactivate your account once changes to the email has been made. </font></td>
								</tr>
							
							
							<tr>
								<td colspan="3" align="center">
								<input type="hidden" value="<?= $a['email'] ?>" name="oldemail">
								<input type="submit" value="Update Email" class="button">
								
								<input type="button" value="Back" class="button" onClick="window.open('os_viewdetails.php','_self')">
								</td>
							</tr>	
							</form>
						</table>
					</td>
				</tr>
		  </table>

<? require("required/footer.php"); ?>